**********************************************************************************
**** Replication Data for: State-Building, Collective Efficacy, and the Co-Production of Public Goods in Rural Africa
*** Authors: Natalie Letsa and Martha Wilfahrt
** Journal: Comparative Political Studies
* File Date: 18 December 2025
**********************************************************************************

cd "/Users/marthawilfahrt/Library/CloudStorage/GoogleDrive-mawilfahrt@gmail.com/.shortcut-targets-by-id/1YQR2toLWEkHCV52GnykhtsVb1hWNDRS_/Colonial Legacies/Writing/Collective Efficacy Paper/Submissions/CPS/Letsa_Wilfahrt_CPS_Replication Files/"

****** FIGURE 5: Village Problems & Problem-Solving on the Benin-Nigeria Border, non-Cash Crop Producing Zones
{
use "Datasets/WB_LSMS_Benin_NGA_Final.dta", clear

collapse (first) Admin1 Benin Country (min) d_border_km (mean)  cashcrop Max_CashCrop  Perc_ProblemRaisedbyState Perc_ProblemRaisedbyCS Perc_ProblemRaisedbyChief Perc_ProblemRaisedbyComm N_Problems services Route groupments ELF Perc_Problems_Discussed Perc_Problems_Project Perc_CommMaindOeuvre Perc_CommDons Perc_CommMaterial Perc_Community_Contributions, by(Final_EA)

drop if d_border_km > 101

* d_border
reg N_Problems Benin  if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_ProblemRaisedbyComm Benin if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_ProblemRaisedbyChief Benin  if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_ProblemRaisedbyCS Benin  if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_ProblemRaisedbyState Benin  if Max_CashCrop < 6, cluster(Admin1) robust


reg N_Problems Benin services Route groupments ELF  if Max_CashCrop < 6, cluster(Admin1) robust
est store NProb
reg Perc_ProblemRaisedbyComm Benin services Route groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store Comm
reg Perc_ProblemRaisedbyChief Benin services Route groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store Chief
reg Perc_ProblemRaisedbyCS Benin services Route groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store CS
reg Perc_ProblemRaisedbyState Benin services Route groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store State

coefplot (NProb,  mcolor(black) msize(small) msymbol(square) ciopts(lcolor(black black) lwidth(thin med))) ///
	(Comm,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med)))  ///
	(Chief, mcolor(black) msize(small) msymbol(square) ciopts(lcolor(black black) lwidth(thin med))) ///
	(CS,  mcolor(black) msize(small) msymbol(diamond) ciopts(lcolor(black black) lwidth(thin med)))  ///
	(State,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med))) , ///
	keep(Benin) vertical yline(0, lcolor(gs12) lwidth(thin)) ///
	title("a. How Problems Arise", size(medlarge)) /// 
	ytitle("Benin") ylabel(-1.5(.5).5) levels(95 90) ///
	xlabel(.67 "# Problems" .83 "Community" 1 "Chief" 1.17 "Civil Society" 1.33 "State", labsize(small)) ///
	legend(off) name("Raising", replace) scheme(s1mono)

reg Perc_Problems_Discussed Benin  if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_Problems_Project Benin if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_CommMaindOeuvre Benin if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_CommDons Benin  if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_CommMaterial Benin  if Max_CashCrop < 6, cluster(Admin1) robust
reg Perc_Community_Contributions Benin if Max_CashCrop < 6, cluster(Admin1) robust

	
reg Perc_Problems_Discussed Benin services Route  groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store Discuss
reg Perc_Problems_Project Benin services Route  groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store Project
reg Perc_CommMaindOeuvre Benin services Route  groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store CommMain
reg Perc_CommDons Benin services Route  groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store CommDons
reg Perc_CommMaterial Benin services Route  groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store CommMaterial
reg Perc_Community_Contributions Benin services Route  groupments ELF  N_Problems if Max_CashCrop < 6, cluster(Admin1) robust
est store CommContr

coefplot (Discuss,  mcolor(black) msize(small) msymbol(square) ciopts(lcolor(black black) lwidth(thin med))) ///
	(Project,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med)))  ///
	(CommMain,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med)))  ///
	(CommDons,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med)))  ///
	(CommMaterial,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med)))  ///
	(CommContr,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med))),  ///
	keep(Benin) vertical yline(0, lcolor(gs12) lwidth(thin)) ///
	title("b. How Problems are Solved", size(medlarge)) /// 
	ytitle("Benin") ylabel(-1.5(1).5) levels(95 90) ///
	xlabel(.64 "% Discussion" .79 "% Project" .93 "% Donate Labor" 1.07 "% Donate $" 1.23 "% Donate Material" 1.35 "% Any Donate", labsize(small)) ///
	legend(off)  name("Solutions", replace) scheme(s1mono)
	
graph combine Raising Solutions, ///
 row(2) ysize(6) xsize(6) name(BnNga, replace)
 }
 
******* FIGURE 6: Exposure to more intensive central rule and contemporary collective efficacy: evidence from Ghana (with 95 and 95% Confidence Intervals)
{
use "Datasets/Ghana_Subnational_Final.dta", clear

mixed CollEff South if Wave == 1 || EA: || hhno: , robust
mixed CollEff South  if Wave == 3 || EA: || hhno: , robust

mixed CollEff Hance_cashcrop  if Wave == 1 || EA: || hhno: , robust
mixed CollEff Hance_cashcrop  if Wave == 3 || EA: || hhno: , robust

mixed CollEff  revCocoa_Suitability_Class   if Wave == 1 || EA: || hhno: , robust
mixed CollEff  revCocoa_Suitability_Class  if Wave == 3 || EA: || hhno: , robust


mixed CollEff South  assets Water_Quality Housing_Quality Female Age RespEduc  ELF if Wave == 1 || EA: || hhno: , robust
est store South_1
mixed CollEff South  assets Water_Quality Housing_Quality Female Age RespEduc  ELF Moved if Wave == 3 || EA: || hhno: , robust
est store South_3

mixed CollEff Hance_cashcrop assets Water_Quality Housing_Quality Female Age RespEduc  ELF if Wave == 1 || EA: || hhno: , robust
est store Hance_1
mixed CollEff Hance_cashcrop assets Water_Quality Housing_Quality Female Age RespEduc  ELF Moved if Wave == 3 || EA: || hhno: , robust
est store Hance_3


mixed CollEff  revCocoa_Suitability_Class  assets Water_Quality Housing_Quality Female Age RespEduc  ELF if Wave == 1 || EA: || hhno: , robust
est store Cocoa_1
mixed CollEff  revCocoa_Suitability_Class  assets Water_Quality Housing_Quality Female Age RespEduc  ELF Moved if Wave == 3 || EA: || hhno: , robust
est store Cocoa_3


coefplot (South_1,  mcolor(black) msize(small) msymbol(square) ciopts(lcolor(black black) lwidth(thin med))) ///
	(South_3,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med))),  ///
	keep(South) vertical yline(0, lcolor(gs12) lwidth(thin)) ///
	title("South", size(medlarge)) /// 
	ytitle("Collective Efficacy") ylabel(-.6(.2).4) levels(95 90) ///
	xlabel(.83 "2009" 1.165 "2018", labsize(small)) ///
	legend(off)scheme(s1mono) xsize(3) ysize(5) plotregion(lcolor(black) lwidth(thin)) name(South, replace)
graph save "South.gph", replace
	
coefplot (Hance_1,  mcolor(black) msize(small) msymbol(square) ciopts(lcolor(black black) lwidth(thin med))) ///
	(Hance_3,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med))),  ///
	keep(Hance_cashcrop) vertical yline(0, lcolor(gs12) lwidth(thin)) ///
	title("Cocoa Exports", size(medlarge)) /// 
	ytitle("") ylabel(-.6(.2).4) levels(95 90) ///
	xlabel(.83 "2009" 1.165 "2018", labsize(small)) ///
	legend(off)scheme(s1mono) xsize(3) ysize(5) plotregion(lcolor(black) lwidth(thin)) name(Cocoa, replace)
graph save "Cocoa.gph", replace

coefplot (Cocoa_1,  mcolor(black) msize(small) msymbol(square) ciopts(lcolor(black black) lwidth(thin med))) ///
	(Cocoa_3,  mcolor(black) msize(small) msymbol(circle) ciopts(lcolor(black black) lwidth(thin med))),  ///
	keep(revCocoa_Suitability_Class) vertical yline(0, lcolor(gs12) lwidth(thin)) ///
	title("Cocoa Suitability", size(medlarge)) /// 
	ytitle("") ylabel(-.6(.2).4) levels(95 90) ///
	xlabel(.83 "2009" 1.165 "2018", labsize(small)) ///
	legend(off)scheme(s1mono) xsize(3) ysize(5) plotregion(lcolor(black) lwidth(thin)) name(Cocoa_Suit, replace)
graph save "Cocoa_Suit.gph", replace


graph combine "South" "Cocoa" "Cocoa_Suit", ///
	row(1)
}
